#include "ulib.h"

int
fork () {
    return syscall (SYS_FORK);
}

int
riskfork () {
    return syscall (SYS_RISKFORK);
}

int
exec (char * name, char * arg) {
    return syscall (SYS_EXEC,name,arg);
}

int
wait () {
    return syscall (SYS_WAIT);
}

int
dup (int fd) {
    return syscall (SYS_DUP,fd);
}

int
open (char * name) {
    return syscall (SYS_OPEN,name);
}

int
read (int fd, char * buf, int sz) {
    return syscall (SYS_READ, fd, buf, sz);
}

int
write (int fd, char * buf, int sz) {
    return syscall (SYS_WRITE, fd, buf, sz);
}

int
close (int fd) {
    return syscall (SYS_CLOSE,fd);
}

int
pipe (int * fds) {
    return syscall (SYS_PIPE, fds);
}

int
exit () {
    return syscall (SYS_EXIT);
}

int
rm (char * name) {
    return syscall (SYS_RM, name);
}

int
ls (void * lsbuf) {
    return syscall (SYS_LS, lsbuf);
}

char
getc () {
    char c;
    read (0, &c, 1);
    return c;
}

void
putc (char c) {
    write (1, &c, 1);
}